package com.kuang.org.service;

import com.kuang.bascic.service.BaseServiceImpl;
import com.kuang.bascic.utils.PageList;
import com.kuang.org.domain.DictionaryDetail;
import com.kuang.org.domain.Dictionarytype;
import com.kuang.org.mapper.DictionaryDetailMapper;
import com.kuang.org.mapper.DictionaryTypeMapper;
import com.kuang.org.query.DictionaryDetailQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class DictionaryDetailServiceImpl extends BaseServiceImpl<DictionaryDetail> implements DictionaryDetailService {
    @Autowired
    private DictionaryDetailMapper dictionaryDetailMapper;
    @Override
    public PageList<DictionaryDetail> pageList1(DictionaryDetailQuery dictionaryDetailQuery) {
        PageList<DictionaryDetail> list = new PageList<>();
        //传入查询分页信息并设置
//        List<DictionaryDetail> rows = dictionaryDetailMapper.selectByPage(dictionaryDetailQuery);
       // 通过typeid去查询detile查询显示出去
        List<DictionaryDetail> row = dictionaryDetailMapper.selectByTpyeid(dictionaryDetailQuery.getId());
        list.setRow(row);
        //查询条数
        Long aLong = dictionaryDetailMapper.selectCountAll(dictionaryDetailQuery);
        list.setTotal(aLong);
        return list;

    }
}
